# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         test03
# Description:  例13.4
# Author:       ASUS
# Date:         2019/4/13
#-------------------------------------------------------------------------------


import fileinput
fileobj = fileinput.input('./files/urls.txt')
print(type(fileobj))
print(fileobj.readline().rstrip())
for line in fileobj:
    line = line.rstrip()
    #如果line不等于空串，输出当前行号和内容
    if line != '':
        print(fileobj.lineno(),':',line)
    else:
        #输出当前正在操作的文件名
        print(fileobj.filename())

